package com.example.backend.api.common;

import lombok.Data;

// Result message class
@Data
public class Result {
    private Integer code;
    private String message;
    private Object data;

    public Result(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }
    public static Result success(Object data){
        return new Result(200,"success",data);
    }
    public static Result success(){
        return new Result(200,"success",null);
    }
    public static Result fail(String message){
        return new Result(400,message,null);
    }
    public static Result fail(){
        return new Result(400,"fail",null);
    }

}
